home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / オンラインウェア / GAME / Xconq 7.0.1.sit / Xconq 7.0.1 / lib / russian-rev.g < prev    next >
Text File  |  1995-08-22  |  12KB  |  510 lines

  1. (game-module "russian-rev"
  2.   (title "Russian Revolution")
  3.   (blurb "The Russian Revolution")
  4.   (variants ; copied from standard.g
  5.     (world-seen false)
  6.     (see-all false)
  7.     (world-size (60 30 360))
  8.     ("Mostly Land" mostly-land
  9.       (true
  10.         (add sea alt-percentile-max 20)
  11.         (add shallows alt-percentile-min 20)
  12.         (add shallows alt-percentile-max 21)
  13.         (add swamp alt-percentile-min 21)
  14.         (add swamp alt-percentile-max 23)
  15.         (add (desert plains forest) alt-percentile-min 21)
  16.         ))
  17.     ("All Land" all-land
  18.       (true
  19.         (add sea alt-percentile-max 1)
  20.         (add shallows alt-percentile-min 1)
  21.         (add shallows alt-percentile-max 2)
  22.         (add swamp alt-percentile-min 2)
  23.         (add swamp alt-percentile-max 4)
  24.         (add (desert plains forest) alt-percentile-min 2)
  25.         ))
  26.     ("Large Countries" large
  27.      (true (set country-radius-max 100))
  28.      )
  29.     )
  30. )
  31.  
  32. (unit-type militia (char "m") (image-name "fremen")
  33.   (help "cheap, weaker than infantry, good for patrol and exploration")
  34. )
  35. (unit-type infantry (char "i") (image-name "soldiers")
  36.   (help "the backbone of the army, captures cities, makes forts")
  37. )
  38. (unit-type cavalry (char "c") (image-name "cavalry")
  39.   (help "fast, explores and fights, good for exploration and reserve")
  40. )
  41. (unit-type police (char "p") (image-name "police")
  42.   (help "spies, fights terrorists, captures neutral troops")
  43. )
  44. (unit-type terrorist (char "t") (image-name "terrorist")
  45.   (help "sneaks around, infiltrates, blows up things")
  46. )
  47. (unit-type train (char "T") (image-name "train")
  48.   (help "moves troops on land, very vulnerable")
  49. )
  50. (unit-type fleet (char "n") (image-name "ca")
  51.   (help "fights and carries troops on sea")
  52. )
  53. (unit-type fort (char "/") (image-name "walltown")
  54.   (help "fort, port and canal")
  55. )
  56. (unit-type town (char "*") (image-name "town20") 
  57.   (help "smaller than a city")
  58. )
  59.  (unit-type city (char "@") (image-name "city19")
  60.   (help "main producer")
  61. )
  62.  
  63. (define m militia)
  64. (define i infantry)
  65. (define c cavalry)
  66. (define p police)
  67. (define t terrorist)
  68. (define T train)
  69. (define n fleet)
  70. (define / fort)
  71. (define * town)
  72. (define @ city)
  73.  
  74. (material-type fuel (help "to move your trains and ships"))
  75. (material-type food (help "to survive"))
  76. (material-type ammo (help "to fight"))
  77.  
  78. (include "stdterr")
  79. ;; to use "stdterr" as it stands:
  80. (add road name "railway")
  81. (add road image-name "road")
  82. (define railway road)
  83.  
  84. (define cities (* @))
  85. (define places (/ * @))
  86. (define troops (m i c))
  87. (define ground (m i c p t))
  88. (define movers (m i c p t T n))
  89. (define water (sea shallows))
  90. (define land (swamp plains forest desert mountains))
  91. (define dry-land (desert plains forest mountains)) ; same as land-t*
  92. ;;; Static relationships.
  93.  
  94. (table vanishes-on
  95.   (ground water true)
  96.   (places (sea shallows swamp) true)
  97.   (n land true)
  98.   (n railway true)
  99.   (u* ice true)
  100.   (T t* true)
  101.   (T railway false)
  102. )
  103.  
  104. ;; Unit-unit capacities.
  105.  
  106. (table unit-size-as-occupant
  107.   (u* u* 500)
  108. ;             m i c p t T  n
  109.   (movers u* (1 2 2 1 1 6 15))
  110. )
  111. (add (T n / * @) capacity (4 10 20 100 200))
  112. (table occupant-max
  113.   (u* u* 100)
  114. )
  115.  
  116. (table road-chance ((town city) (town city) (1 5) (10 90)))
  117.  
  118. ;;; Unit-terrain capacities.
  119.  
  120. ;; Limit units from 4 to 16 in one cell.
  121. ;;  Places cover the entire cell, however.
  122.   
  123. (table unit-size-in-terrain
  124.   (m t* 2)
  125.   ((i c n T) t* 4)
  126.   ((p t) t* 1)
  127.   (places t* 16)
  128. )
  129. (add t* capacity 16)
  130. (add railway capacity 4)
  131. (table terrain-capacity-x (T railway 2))
  132.  
  133. ;;; Unit-material capacities.
  134.  
  135. (table unit-storage-x
  136. ;            m  i  c p t  T   n   /   *   @
  137.   (u* food ( 5  8 15 8 4 50 200 200 400 800))
  138.   (u* fuel ( 0  0  0 0 0 50 200 200 400 800))
  139.   (u* ammo ( 5 10 10 3 1 25 100 100 200 400))
  140. )
  141.  
  142. ;; A game's starting units will be full by default.
  143. (table unit-initial-supply (u* m* 9999))
  144.  
  145. ;;; Vision.
  146.  
  147. (add places already-seen true)
  148. (add cities see-always true)
  149. (table visibility
  150.   (u* t* 100)
  151.   (t t* 10)
  152.   (t (mountains forest) 1)
  153. )
  154. ;                    m i c p t T n / *  @
  155. (add u* stack-order (3 4 5 2 1 6 7 8 9 10))
  156.  
  157. ;;; Actions.
  158.  
  159. ;                      m  i  c  p  t  T  n  /  *  @
  160. (add u* acp-per-turn ( 2  2  4  2  2  6  4  1  1  1))
  161. (add movers acp-min  (-1 -1 -2 -1 -1 -3 -2))
  162.  
  163. ;;; Movement.
  164.  
  165. (add places speed 0)
  166. (add movers speed 100)
  167.  
  168. ;(table mp-to-enter-unit
  169. ;   (u* u* 1)
  170. ;   (T n 6)
  171. ;)
  172. ; the above don't seem to work properly...
  173. (table mp-to-enter-unit
  174.    (u* u* 0)
  175. )
  176.  
  177. (table mp-to-enter-terrain 
  178.   (u* t* 99)
  179.   (ground (plains desert) 1)
  180.   (ground (forest mountains) 2)
  181.   (n water (1 2))
  182.   (c (forest mountains) (3 4))
  183.   ((m p t) swamp 2)
  184.   (movers railway 0)
  185. ;                m i c p t T n 
  186.   (movers river (2 2 4 2 2 6 1))
  187. ;                          ^
  188. ; should be 99, but then trains can't cross rivers even on bridges
  189. )
  190. (table mp-to-traverse
  191.   (movers river 99)
  192.   (n river 2)
  193.   (movers railway 1)
  194.   ((c n) railway (2 99))
  195. )
  196.  
  197. (table material-to-move ((n T) fuel 1))
  198. (table consumption-per-move ((n T) fuel 1))
  199.  
  200. ;;; Construction.
  201.  
  202. ;           m  i  c  p  t  T  n  / * @
  203. (add u* cp (8 12 20 20 16 16 34 12 1 1))
  204. (table acp-to-create
  205.   (troops / (2 2 4))
  206.   (cities movers 1)
  207.   )
  208. (table cp-on-creation
  209.   (troops / 1)
  210.   (* movers 1)
  211.   (@ movers 2)
  212.   )
  213. (table acp-to-build
  214.   (troops / (2 2 4))
  215.   (cities movers 1)
  216.   )
  217. (table cp-per-build
  218.   (troops / (1 2 1))
  219.   (* movers 1)
  220.   (@ movers 2)
  221.   )
  222. (table occupant-can-construct
  223.   (u* u* false)
  224.   )
  225.  
  226. ;(define constr (i c p t  T  n))
  227. ;(table tp-to-build
  228. ;     (* constr (8 8 6 6 20 20))
  229. ;     (@ constr (4 4 3 3 10 10))
  230. ;)
  231. ;(table acp-to-toolup (cities constr 1))
  232. ;(table tp-per-toolup (cities constr 1))
  233. ;(table tp-max        (cities constr 100))
  234. ; the above make construction of i c p t T n impossible
  235.  
  236. ;;; Repair.
  237.  
  238. ;; Automatic repair work.
  239. (add (  m    i    c    n    /    *    @ ) hp-recovery 
  240.      (0.25 0.50 0.25 0.50 0.25 0.50 1.00)
  241. )
  242.  
  243. ;;; Explicit repair actions accelerate the recovery of lost hp.
  244.  
  245. (table acp-to-repair
  246.   (places u* 1)
  247.   (n movers 1)
  248.   ((m i) places 1)
  249. )
  250. (table hp-per-repair
  251.   (/ u* 0.50)
  252.   (cities u* 1.00)
  253.   (n ground 0.50)
  254.   (n n 0.50)
  255.   (i places 1.00)
  256.   (m places 0.50)
  257. )
  258.  
  259. ;;; Production.
  260.  
  261. (table base-production
  262.   (ground food 1)
  263.   (c food 2)
  264. ; until troop to get food from terrain
  265.   (places fuel (10 20 40))
  266.   (places food (10 20 40))
  267.   (places ammo ( 5 10 20))
  268. )
  269. (table productivity
  270.   (u* t* 0)
  271.   (ground (plains forest) 100)
  272.   (c forest 50)
  273.   (/ dry-land (100 50 30 30))
  274.   (* dry-land (100 50 30 30))
  275.   (@ dry-land (100 50 30 30))
  276. )
  277. ; the above does not work :-)
  278.  
  279. ; (table terrain-storage-x ((forest plains) food (3 12)))
  280. ; (table terrain-initial-supply ((forest plains) food (3 12)))
  281. ; (table terrain-base-production ((forest plains) food (1 3)))
  282. ; but then no way for troop to get food from terrain
  283.  
  284. (table base-consumption
  285.   (movers food 1)
  286.   ((c T) food (2 0))
  287. )
  288. (table hp-per-starve
  289.   (movers food 0.5)
  290. )
  291.  
  292. ;;; Combat.
  293.  
  294. ;                        m i c p t T n /  *  @
  295. (add u* hp-max          (2 3 2 2 1 1 8 5 10 25))
  296. ;(add u* hp-at-min-speed(0 0 0 1 0 0 2 1  3  5)) ; broken?
  297.  
  298. (table hit-chance
  299. ;         m  i  c  p  t  T  n  /  *  @
  300.   (m u* (70 50 40 50 50 50 10 30 25 15))
  301.   (i u* (80 70 50 80 75 70 20 50 40 30))
  302.   (c u* (80 60 80 80 80 60 00 30 20 10))
  303.   (p u* (40 30 30 50 75 40 00 05 20 10))
  304.   (t u* (40 30 10 10 75 40 20 40 60 50))
  305.   (T u* 0)
  306.   (n u* (60 50 30 60 30 70 60 60 70 80))
  307.   (/ u* (60 50 60 60 10 30 10 00 00 00))
  308.   (* u* (40 35 40 50 05 40 20 00 00 00))
  309.   (@ u* (60 50 60 70 05 50 30 00 00 00))
  310. )
  311.  
  312. (table damage
  313.   (u* u* 1)
  314. ;         m i c p t T n / * @
  315.   (t u* ( 2 3 2 1 1 1 2 5 5 9 ))
  316.   (n u* ( 2 2 2 2 1 1 2 2 3 4 ))
  317. )
  318. ; does the above really work?
  319.  
  320. (table capture-chance
  321.   ((m i c) T (30 50 40))
  322.   (m places (10 20 15))
  323.   (i places (20 40 30))
  324.   (c places ( 5 20 15))
  325. )
  326.  
  327. (table independent-capture-chance
  328.   (p movers 50) 
  329.   (p (p t) 0)
  330.   ((m i c) T (60 90 70))
  331.   (m places (20 40 30))
  332.   (i places (40 75 60))
  333.   (c places (10 40 30))
  334.   (i n 30)
  335. )
  336.  
  337. (table ferry-on-entry
  338.    (u* u* over-own)
  339.    (n movers over-border)
  340. )
  341. (table ferry-on-departure
  342.    (u* u* over-own)
  343.    (n movers over-border)
  344. )
  345. (table bridge (i places true) (p movers true))
  346.  
  347. (table protection 
  348.   (/ movers 80)
  349.   (* movers 65)
  350.   (@ movers 50)
  351.   (i places (70 80 80))
  352.   ((m c) places 90)
  353. )
  354.  
  355. (table consumption-per-attack (u* ammo 1))
  356. (table hit-by (u* ammo 1))
  357.  
  358. (table acp-to-attack
  359.   (m u* 2)
  360.   (i u* 2)
  361.   (c u* 4)
  362.   (p u* 2)
  363.   (t u* 1)
  364.   (n u* 1)
  365. )
  366.  
  367. ;;; Revolt & surrender.
  368.  
  369. (table surrender-range (u* u* 1))
  370.  
  371. (table defend-terrain-effect
  372.    ((m i) mountains (80 90))
  373.    ((m i) forest (90 95))
  374.    (/ mountains 80)
  375.    (n shallows 150)
  376. )
  377.  
  378. ; this is a civil war:  everybody revolts and turns coat
  379. (add u* acp-to-change-side 1)
  380. ; excluding politically-aware units
  381. (add (p t) acp-to-change-side 0)
  382.  
  383. (add places revolt-chance 0.50)
  384. (add movers revolt-chance 0.15)
  385. (add (p t) revolt-chance 0.00)
  386. (add m revolt-chance 0.30)
  387.  
  388. (table surrender-chance
  389.   (m u* 1.00)
  390.   (u* u* 0.50)
  391.   ((i c @) u* 0.20)
  392.   (/ u* 0.10)
  393.   (n u* 0.05)
  394.   ((p t) u* 0.00)
  395.   (t p 0.10)
  396.   (u* (t /) 0)
  397. )
  398.  
  399. (add p possible-sides '(not "independent"))
  400. (add t possible-sides '(not "independent"))
  401.  
  402. (table can-enter-independent (t (T * @) true))
  403. ; should be able to enter even hostile units!
  404.  
  405. ;;; Spying.
  406.  
  407. (add p spy-chance 25.00)
  408. (add p spy-range 2)
  409.  
  410. ;;; Accidents.
  411.  
  412. (table attrition
  413.   (n shallows 4.00)
  414.   (troops swamp 5.00)
  415.   (c (mountains forest desert) (2.00 1.00 1.00))
  416. )
  417.  
  418. ;;; Scoring.
  419.  
  420. (add u* point-value 0)
  421. (add (i c / * @) point-value (1 1 1 10 30))
  422.  
  423. ;;; Initial setup.
  424.  
  425. (table favored-terrain
  426.   (n water (100 20))
  427.   (ground plains 100)
  428.   (ground forest 20)
  429.   (t (plains forest) (50 100))
  430. ;               ~   +  %  ^
  431.   (/ dry-land (20 100 10 20))
  432.   (@ dry-land (25 100 10 10))
  433.   (* dry-land (40 100 20 20))
  434. )
  435.  
  436. (table independent-density add (places t* (10 100 30)))
  437.  
  438. (add @ start-with 1)
  439. (add * independent-near-start 3)
  440. (set country-separation-min 12)
  441. (set country-separation-max 60)
  442. (set country-radius-min 4)
  443.  
  444. ;; Naming.
  445.  
  446. (include "town-names")
  447. (add places namer "random-town-names")
  448.  
  449. ;; Sides.
  450.  
  451. (set sides-min 2)
  452. (scorekeeper (do last-side-wins)) ; for now
  453.  
  454. (set side-library '(
  455. ; ------------ parties
  456.   ((noun "Bolshevik") (color "red") (emblem-name "hammer-and-sickle"))
  457.   ((noun "Red") (color "red") (emblem-name "soviet-star"))
  458.   ((noun "Menshevik") (color "black,pink"))
  459.   ((noun "Tzarist") (color "blue") (emblem-name "arms-russia"))
  460.   ((noun "White") (color "white,black") (emblem-name "arms-russia"))
  461. ; ------------ peoples
  462.   ((noun "Russian") (color "blue,red")
  463.                     (emblem-name "flag-russia"))
  464.   ((noun "Ukrainian") (color "yellow,blue")
  465.                       (emblem-name "flag-ukraine"))
  466.   ((noun "Georgian") (emblem-name "flag-georgia"))
  467.   ((noun "Azer") (emblem-name "flag-azerbaijan"))
  468.   ((noun "Armenian") (emblem-name "flag-armenia"))
  469.   ((noun "Cossack") (color "white,blue"))
  470. ; ------------ foreign powers
  471.   ((noun "Polish") (color "white,red") (emblem-name "flag-poland"))
  472.   ((noun "Czechoslovak") (color "red,blue")
  473.                          (emblem-name "flag-czech"))
  474.   ((noun "German") (color "gray,black,white")
  475.                    (emblem-name "german-cross"))
  476.   ((noun "Turkish") (emblem-name "crescent"))
  477.   ((noun "Japanese") (color "red,white,black")
  478.                      (emblem-name "flag-japan"))
  479. ; ((noun "Chinese") (color "red,yellow") (emblem-name "flag-dragon")) 
  480. ))
  481.  
  482.  
  483. (game-module (design-notes (
  484.   "This game is under developement;"
  485.   "Massimo Campostrini (campo@sunthpi3.difi.unipi.it)."
  486.   ""
  487.   "Tooling up does not work, so it is commented out."
  488.   ""
  489.   "Troops seem to be unable to collect food from terrain,"
  490.   "so terrain-storage-x and friends are commented out"
  491.   "and troops make their own food."
  492.   ""
  493.   "Police is supposed to be able to capture neutral troops;"
  494.   "need to implement this in Xconq 7.0"
  495. )))
  496. (game-module (notes (
  497.   "This games tries to model Russia at the time of the Revolution."
  498.   ""
  499.   "About 60% of your production should be infantry",
  500.   ""
  501.   "Trains can move your troops around fast,"
  502.   "but they should never get close to the front."
  503.   ""
  504.   "Terrorists should infiltrate enemy territory"
  505.   "and blow up trains and other things."
  506.   "Police should try to avoid this."
  507.   ""
  508.   "A fort can be built to block a railway."
  509. )))
  510.